package boot.controller;

import boot.entity.Person;
import boot.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: zhiyu
 * @Date:11:42
 * @DESC:
 */
@Controller
public class Testcontroller {
    @GetMapping("/Test.html")
    public String showTest(Model model){
        model.addAttribute("username","zhangsan");
        return "Test";
    }
    @PostMapping("/saveUser")
    @ResponseBody
    public Person saveUser(Person person){
        return person;
    }
}
